#!/usr/bin/env python

import argparse
import sys
import os
import decimal
#sys.path.append("/Users/roosevelt/Desktop/bayes/trunk/modules/")
sys.path.append("/home/roosevelt/Desktop/bayes/trunk/modules/")
from BayesNetwork import BayesNetwork

parser = argparse.ArgumentParser(description='Generate data using forward sampling.')
parser.add_argument('-r', help='The path to the BN to be sampled')
parser.add_argument('-n', help='Number of samples to generate')
parser.add_argument('-o', help='The output file name')
parser.add_argument('-p', help='The probability of a missing value')

args = parser.parse_args()

path = vars(args)['r']
num = vars(args)['n']
output = vars(args)['o']
prob = vars(args)['p']

BN = BayesNetwork()
BN.parse(path)
BN.forwardSampling(int(num), output, decimal.Decimal(prob))
BN.loadDataset(output)